package edu.sctu.practice.class02.liqing.assignment03.assignment03_01;

import edu.sctu.practice.class02.liqing.assignment03.assignment03_01.Circle;
import edu.sctu.practice.class02.liqing.assignment03.assignment03_01.Rectangle;

/**
 * Created by 123456 on 2015/10/23.
 */
public class Exam01 {
    static boolean equalArea(GeometricObject object1,GeometricObject object2 ){
        return object1.findArea() == object2.findArea();

    }
    static void displayGeometricObject(GeometricObject object){
        System.out.println();
        System.out.println(object.toString());
        System.out.println("图形颜色为："+object.getColor());
        System.out.println("图形面积为："+ object.findArea());
        System.out.println("图形周长为："+object.findPerimeter());
    }
    public static void main(String[] args) {
        Circle a = new Circle("红色",1.0);
        Rectangle b = new Rectangle("黑色",2.0,3.0);
       displayGeometricObject(a);
        displayGeometricObject(b);
        System.out.println();
        System.out.println("比较图形面积是否相同的结果为:"+equalArea(a,b));
    }
}
